/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package by.vdl.websort.server.dao.rowmapper;

import by.vdl.websort.server.entity.UserDTO;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author zeor
 */
public class UserMapper implements RowMapper<UserDTO>{

    public UserDTO mapRow(ResultSet rs, int i) throws SQLException {
        UserDTO userDTO = new UserDTO();
        userDTO.setId(rs.getLong("id"));
        userDTO.setName(rs.getString("name"));
        userDTO.setPassword(rs.getString("password"));
        userDTO.setIp(rs.getString("ip"));
        userDTO.setHash(rs.getString("hash"));
        
        return userDTO;
    }
    
}
